package cn.iocoder.yudao.module.promotion.convert.points;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.promotion.controller.admin.points.pointsproduct.PointsProductRespVO;
import cn.iocoder.yudao.module.promotion.controller.admin.points.vo.pointsactivity.*;
import cn.iocoder.yudao.module.promotion.dal.dataobject.points.PointsActivityDO;
import cn.iocoder.yudao.module.promotion.dal.dataobject.points.PointsProductDO;
import cn.iocoder.yudao.module.promotion.dal.dataobject.seckill.SeckillActivityDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 积分活动 Convert
 *
 * @author 超级管理员
 */
@Mapper
public interface PointsActivityConvert {

    PointsActivityConvert INSTANCE = Mappers.getMapper(PointsActivityConvert.class);

    PointsActivityDO convert(PointsActivityCreateReqVO bean);

    PointsActivityDO convert(PointsActivityUpdateReqVO bean);

    PointsActivityRespVO convert(PointsActivityDO bean);

    List<PointsActivityRespVO> convertList(List<PointsActivityDO> list);

    PageResult<PointsActivityRespVO> convertPage(PageResult<PointsActivityDO> page);

    List<PointsActivityExcelVO> convertList02(List<PointsActivityDO> list);

    default PointsActivityRespVO convert(PointsActivityDO activity, List<PointsProductDO> products) {
        return convert(activity).setProductsList(convertList2(products));
    }

    List<PointsProductRespVO> convertList2(List<PointsProductDO> productDOs);

    List<ActivityListVO> convertList03(List<PointsActivityDO> list);

    List<ActivityListVO> convertList04(List<SeckillActivityDO> list);
}
